<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <p>llllllll</p>
    <p id="p">hhhhhh</p>
    <script>
        window.onload = function () {
            // document.write("<p>Hello</p>")
            var pTag = document.getElementById("p");
            // Element没有write方法，下面调用会报错
            // pTag.write("Hello")
        }
        document.write("<p>Hello</p>")
        document.write("<p>Hello</p>")
    </script>
</body>

</html>